package com.duing.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

@Data
@TableName("user")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Long id;
    @NotBlank(message = "姓名不能为空")
    private String name;
    private String password;
    private Integer age;
    private Integer job;
    @NotBlank(message = "账号不能为空")
    private String username;
}
//如果 @TableId(type = IdType.AUTO) 无效 去执行：  DELETE FROM user WHERE id > 1000; ALTER TABLE user AUTO_INCREMENT = 9;
//ALTER TABLE user MODIFY `id` BIGINT AUTO_INCREMENT;
//ALTER TABLE user ADD COLUMN username VARCHAR(200);
